/*
    Copyright (c) 2008-2009, Prashanta Shrestha All Rights Reserved.
    Available under GNU Lesser General Public License >= 3.0 as published by the Free Software Foundation.
    see <http://www.gnu.org/licenses/>
*/
/*-----------------------------------------------------------------------------------
  CLASS : qDojo.dijix.ViewPanel
  =============================
  - General purpose view panel      
  -----------------------------------------------------------------------------------*/
  
dojo.provide("qDojo.dijix.ViewPanel");

dojo.require("qDojo.core.AjaxHandler");
dojo.require("dijit.layout.ContentPane");
dojo.require("dojo.fx");  
dojo.require("dojox.fx.ext-dojo.NodeList"); 


dojo.declare("qDojo.dijix.ViewPanel", [ dijit.layout.ContentPane , qDojo.core.AjaxHandler ] , {
		
		// ----------------------------------------------------------------------
		//	Post create widget
		// ======================================================================
		postCreate: function() 
		{		
			this.inherited(arguments);								
		},
		renderViewByUrl: function(url)
		{
		    console.log("gettingurl: " + url); 
		    this.attr("href",url);
		},
		// ======================================================================
		//	Render response from server - OVERRIDE this in derivate of this 
		//  class to get control over view rendering when server response is received
		//  or CONNECT if more render function need to be added while retaining original
		//  render function
		// ----------------------------------------------------------------------	
		renderView: function(payload , event , responseType)
		{
		  if(payload.url)
	           this.attr("href",payload.url);
          else if(payload.content)
               this.attr("content",payload.content);  	           	           	                			
		}
});
